from rest_framework.viewsets import GenericViewSet

from permissions.services import PermissionService
from utils.addons.responses import SuccessResponse


class PermissionsViewSet(GenericViewSet):

    def list(self, request):
        user = request.user
        params = request.query_params
        ret = PermissionService.get_dict_type_permissions(user, params)

        return SuccessResponse(ret)
